import { defineStore } from "pinia";
import https from "../utils/https";
export const useDefault = defineStore("default", {
    state: () => {
        return {
            pagerouter: [] as any,
            users:JSON.parse(localStorage.getItem("users")||"{}"),
        }
    },
    actions: {
        async getpages() {
            let res = await https.get("/api/page", { params: { status: "publish" } })
            if (res.status == 200) {
                this.pagerouter = res.data.data[0]
            }
        },
        getusers(obj:any){
            localStorage.setItem("users",JSON.stringify(obj))
        }
    },
    getters: {

    }
})